//package evil.wolf.components;
//
//import evil.wolf.list.BusinessMaterial;
//import evil.wolf.list.ObjectMaterial;
//
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//import java.awt.event.MouseEvent;
//import java.awt.event.MouseListener;
//import java.util.ArrayList;
//
//import javax.swing.JMenuItem;
//import javax.swing.JOptionPane;
//import javax.swing.JPopupMenu;
//import javax.swing.JTable;
//import javax.swing.ListSelectionModel;
//import javax.swing.table.AbstractTableModel;
//import javax.swing.table.TableModel;
//
//
//public class TableOfMaterial   {
//	
//	int colCount;
//	private int index[];
//	JPopupMenu menu = new JPopupMenu("Popup");
//	ObjectMaterial objectMaterial = new ObjectMaterial();
//	String action = null;
//	BusinessMaterial rs = new BusinessMaterial(objectMaterial);
//	@SuppressWarnings("unchecked")
//	public ArrayList<ObjectMaterial> materials = rs.getListRecords();//new ArrayList<ObjectMaterial>();
//	public JTable myTable;
//	TableModel dataModel;
//	
//	public void TableOfMaterial() {
////		
////		dataModel = new MyTableModel(materials);
////		myTable = new JTable(dataModel);
////		myTable.addMouseListener(this);
////		myTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
////		
////	    JMenuItem item = new JMenuItem("Edit selected row");
////	    item.addActionListener(new ActionListener() {
////
////			@Override
////			public void actionPerformed(ActionEvent arg0) {
////				System.out.println("Menu item Test1Edit this row");
////			}
////	    });
////	    menu.add(item);
////	    item = new JMenuItem("Delete selected row");
////	    item.addActionListener(new ActionListener() {
////	    	
////	      public void actionPerformed(ActionEvent e) {
////	    	  
////	    	  if(JOptionPane.showConfirmDialog(null, "Do you really want to delete this row?", "CONFIRM", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){
////	    	  }
////	      }
////	    });
////	    
////	    menu.add(item);
////	    
//////		return myTable;
////	}
//	
////	public int getSelectedRow() {
////		index = myTable.getSelectedRows();
////		return index[0];
////	}
////	public String getAction(){
////		return action;
////	}
////	
////	public void setAction(String action){
////		 this.action = action;
////	}
////	
////	@Override
////	public void mouseClicked(MouseEvent me) {
////		
////		if(me.getClickCount() == 2 && !me.isConsumed()) {
////			me.consume();
////			setAction("UPDATE");
//////			HangHoa hanghoa = new HangHoa(objectMaterial, this);
//////			
//////			objectMaterial.setmah((String) getValueAt( getSelectedRow(), 0));
//////			hanghoa.txtmah.setText(objectMaterial.getmah());
//////			
//////			objectMaterial.settenh((String) getValueAt( getSelectedRow(), 1));
//////			hanghoa.txttenh.setText(objectMaterial.gettenh());
//////			
//////			objectMaterial.setmanh((String) getValueAt( getSelectedRow(), 2));
//////			hanghoa.txtmanh.setText(objectMaterial.getmanh());
//////			
//////			objectMaterial.setdvt((String) getValueAt(  getSelectedRow(), 3));
//////			hanghoa.txtdvt.setText(objectMaterial.getdvt());
//////			
//////			objectMaterial.setdd((String) getValueAt(  getSelectedRow(), 4));
//////			hanghoa.txtdd.setText(objectMaterial.getdd());
//////
//////			hanghoa.setVisible(true);
////		}
////		
////	}
////	@Override
////	public void mouseEntered(MouseEvent e) {
////		// TODO Auto-generated method stub
////		
////	}
////	@Override
////	public void mouseExited(MouseEvent e) {
////		// TODO Auto-generated method stub
////		
////	}
////	@Override
////	public void mousePressed(MouseEvent ev) {
////		if (ev.isPopupTrigger() && this.getSelectedRow() != -1 ) {
////	          menu.show(ev.getComponent(), ev.getX(), ev.getY());
////	        }
////		
////	}
////	@Override
////	public void mouseReleased(MouseEvent ev) {
////		if (ev.isPopupTrigger() && this.getSelectedRow() != -1 ) {
////	          menu.show(ev.getComponent(), ev.getX(), ev.getY());
////	        }
////		
////	}
////	
////@SuppressWarnings("serial")
////public class MyTableModel extends AbstractTableModel {
////		
////		String[] header = rs.colName;
////		int colCount = rs.colCount;
////		ArrayList<ObjectMaterial> materials;
////		
////		// constructor 
////		MyTableModel(ArrayList<ObjectMaterial> materials) {
////			this.materials = materials;
////		}
////		
////		@Override
////		public String getColumnName(int i) {
////			
////		    return this.header[i];
////		}
////		
////		@Override
////		public int getColumnCount()	{
////			return colCount;
////		}
////		
////		@Override
////		public int getRowCount() {
////			
////			return materials.size();
////		}
////		
////		@Override
////		public Object getValueAt(int row, int col) {
////			ObjectMaterial material = materials.get(row);
////					
////			switch (col) {
////			case 0: return material.getmah();
////			case 1: return material.gettenh();
////			case 2: return material.getmanh();
////			case 3: return material.getdvt();
////			case 4: return material.getdd();
////			default: return 1;
////			
////			}
////		}
//	}
//}